//
//  CommTools.h
//  TTAddressBook
//
//  Created by hubin on 11-12-19.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#define MakeRgbColor(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

#define UIImageByBundle(name,type) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(name) ofType:(type)]]

#define WAIT_TIME   5  //验证码等待时间

extern NSString * const kVersion;   //版本号

typedef enum {
    UsernameTextfieldTag=1000,
    PasswordTextfieldTag,
    CodeNumberTextfieldTag,
    UsernameAlertTag,
    PasswordAlertTag,
    CodeNumberAlertTag,
    RegistionAlertTag,
    RegSuccessAlertTag,
    DownloadListAlertTag,
    NetworkDownloadAlertTag,
    NetworkUploadAlertTag,
    NetworkAlertTag,
    NetworkQRSAlertTag,             //检查是否注册提示
    NetworkRAlertTag,               //获取验证码提示
    NetworkRVAlertTag,              //注册提示
    LoginAlertTag,
    AfterAlertTag,                  //“以后再说”提示
    SmsNotSupportAlertTag,          //不支持发送短信功能提示
    ActivateAlertTag,               //一键激活提示
    BackupAlertTag,                 //备份提示
    ChangeAccountActionSheetTag,    //更换帐号提示
    ChangePicActionSheetTag,        //更换头像提示
    AllowPushingActionSheetTag      //是否允许推送通知的提示
}ControllerTag;

@interface CommTools : NSObject

+ (Boolean)isNumberCharaterString:(NSString *)str;
+ (Boolean)isNumberString:(NSString *)str;
+ (Boolean)isSameday:(NSDate *)date1 Date2:(NSDate *)date2;
+ (void)setButtonImage:(UIButton*)btn normalpic:(NSString*)normalpic selectedpic:(NSString*)selectedpic disablepic:(NSString*)disablepic;

//调用发短信界面，调用者需要根据返回类型来判断是否支持程序中调用短信界面。返回NO，表示不支持。
+ (BOOL)callMessageCompose: (id)composeDelegate bodyOfMessage:(NSString *)body numOfMessage:(NSString *)num;

@end
